package com.yf.course.modules.course.dto.ext;

import com.yf.base.api.annon.Dict;
import com.yf.course.modules.course.dto.CourseRefFileDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* <p>
* 课程文件索引数据传输类
* </p>
*
* @author 聪明笨狗
* @since 2021-03-12 16:18
*/
@Data
@ApiModel(value="课程文件索引", description="课程文件索引")
public class CourseRefFileExtDTO extends CourseRefFileDTO {


    @ApiModelProperty(value = "课件名", required=true)
    private String title;

    @Dict(dicCode = "course_file_type")
    @ApiModelProperty(value = "文件类型", required=true)
    private String fileType;
    private String fileType_dictText;

    @ApiModelProperty(value = "文件地址", required=true)
    private String fileUrl;

    @ApiModelProperty(value = "预览地址", required=true)
    private String viewUrl;

    @ApiModelProperty(value = "已读秒数", required=true)
    private Integer learnSec;

    @ApiModelProperty(value = "是否已解锁")
    private Boolean unlocked;

    /**
     * 默认未解锁状态
     * @return
     */
    public Boolean getUnlocked(){
        if(this.unlocked== null){
            return false;
        }
        return this.unlocked;
    }

}
